package light.head.controller.sys;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import light.head.constant.Parm;
import light.head.constant.Url;
import light.head.dao.sys.FileDAO;
import light.head.enm.RESULT;
import light.head.framework.base.SupporterController;
import light.head.framework.entity.PageBean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


public class FileController extends SupporterController {

	private FileDAO fileDAO;

	@RequestMapping(value = Url.INIT)
	public ModelAndView file(HttpServletRequest request, HttpServletResponse response) throws Exception {
		PageBean pb = createPageBean(request);
		Map<String, String> map = createQueryMapByParmName(request, Parm.EMAIL, Parm.REAL_NAME, Parm.ROLE_CODE, Parm.DELETED);
		
		if (fileDAO.findByMap(cu_organCode(request), map, pb) == RESULT.SUCCESS)
			request.setAttribute(Parm.PAGE_BEAN, pb);
		return new ModelAndView("");
	}
	@Autowired
	public void setFileDAO(FileDAO fileDAO) {
		this.fileDAO = fileDAO;
	}

}
